<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <style>
        body {
            margin: 30px;
        }

        #demo {
            position: relative;
        }

        button {
            position: absolute;
        }

        .no-mode-fade-enter-active,
        .no-mode-fade-leave-active {
            transition: opacity 1s linear
        }

        .no-mode-fade-enter-from,
        .no-mode-fade-leave-to {
            opacity: 0
        }

        button {
            background: #05ae7f;
            border-radius: 4px;
            display: inline-block;
            border: none;
            padding: 0.5rem 0.75rem;
            text-decoration: none;
            color: #ffffff;
            font-family: sans-serif;
            font-size: 1rem;
            cursor: pointer;
            text-align: center;
            -webkit-appearance: none;
            -moz-appearance: none;
        }
        
    </style>
    <script src='./vue.global.js'></script>
</head>

<body>
    <div id="demo">
        <transition name="no-mode-fade">
            <button v-if="on" key="on" @click="on = false">
                on
            </button>
            
            <button v-else key="off" @click="on = true">
                off
            </button>
        </transition>
    </div>
    <script>
        const Demo = {
            data() {
                return {
                    on: false
                }
            }
        }

        Vue.createApp(Demo).mount('#demo')
    </script>
</body>

</html>